﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Data
{
    public class PlaylistConnector
    {
        #region Объектная модель
        static protected readonly Dictionary<Guid, PlaylistConnector> _allPlaylistConnectors = new Dictionary<Guid, PlaylistConnector>();
        static public Dictionary<Guid, PlaylistConnector> AllPlaylistConnectors { get { return _allPlaylistConnectors; } }

        protected Guid _id { get; private set; }
        public Guid ID
        {
            get { return _id; }
        }

        static private readonly String _tableName = "[playlistconnectors]";
        static public String TableName
        {
            get { return _tableName; }
        }

        static public PlaylistConnector GetById(Guid id)
        {
            return _allPlaylistConnectors[id];
        }
        #endregion

        private Guid _songId;
        public Song Song
        {
            get { return Song.GetById(_songId); }
            set { _songId = value.ID; }
        }

        private Guid _playlistId;
        public Playlist Playlist
        {
            get { return Playlist.GetById(_playlistId); }
            set { _playlistId = value.ID; }
        }
        public PlaylistConnector()
        {
            _id = Guid.NewGuid();
            _allPlaylistConnectors.Add(this._id, this);
        }


    }
}
